package com.zmj.exception;

import lombok.Data;

/**
 * 自定义异常
 *
 * @author zmj
 * @date 2021-08-27 10:28
 */
@Data
public class CustomizeException extends RuntimeException {

    private ErrorCodeEnum errorCodeEnum;

    public CustomizeException(ErrorCodeEnum errorCodeEnum) {
        super(errorCodeEnum.getMsg());
        this.errorCodeEnum = errorCodeEnum;
    }

    public ErrorCodeEnum getErrorCodeEnum() {
        return errorCodeEnum;
    }

    public String getCode() {
        return errorCodeEnum.getCode();
    }

    public String getMsg() {
        return errorCodeEnum.getMsg();
    }

}
